/*
 * test_wordfilter.cpp
 *
 *  Created on: Jan 2, 2014
 *      Author: killerg
 */




#include "share/word_filter.h"
#include <assert.h>

bool test_wordfilter() {
    WordFilter wf;
    if (!wf.init())
        return false;

    assert(!wf.checkName("sb", EFM_CreateRole, 1, 8));
    assert(!wf.checkName("圣战组织", EFM_CreateRole, 1, 8));
    assert(!wf.checkName("lalalalal", EFM_CreateRole, 1, 8));
    assert(!wf.checkName("", EFM_CreateRole, 1, 8));
    assert(wf.checkName("1234567", EFM_CreateRole, 1, 8));

    assert(!wf.checkName("sb", EFM_Naming, 1, 8));
    assert(!wf.checkName("圣战组织", EFM_Naming, 1, 8));
    assert(!wf.checkName("lalalalal", EFM_Naming, 1, 8));
    assert(!wf.checkName("", EFM_Naming, 1, 8));
    assert(wf.checkName("1234567", EFM_Naming, 1, 8));

    return true;
}
